Skip to content

feat(offload): add docker-offload-plugin deb/rpm packaging - #562

Merged
vvoland merged 1 commit into
docker:mainfrom
nicksieger:offload-packaging
Nov 18, 2026
Merged

vvoland merged 1 commit into
docker:mainfrom
nicksieger:offload-packaging

Conversation

@nicksieger

@nicksieger nicksieger commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add deb/rpm packaging for the docker-offload CLI plugin (pkg/offload), for ubuntu2404, ubuntu2604 and rockylinux8 on linux/amd64 and linux/arm64.
  • The package build compiles the plugin from source in dh_auto_build and the rpm %build, through the ce-release make target of the source tree, as pkg/model does.
  • The source repo is private, so there is no PKG_REPO/PKG_REF clone. The caller passes the vendored source tree as the src named context, and builds run from the source repo's own workflow.
  • Offload is not in PKGS_BASE, so docker buildx bake pkg does not include it. The caller adds it with PKGS_EXTRA in a remote Bake override (see Remote override). The override also declares the release inputs (VERSION, COMMIT, BUILD, DATE) and sets them as args on _pkg-offload, along with the build-env file secret. No shared Bake variable or pkg.secret change is needed.
  • Offload is excluded from the nightly package list (.pkgs.yml), which builds every pkg/* directory.
  • GO_VERSION is pinned to the release toolchain (1.27.3). The strip steps are disabled (override_dh_strip for deb, __brp_strip and __brp_strip_comment_note for rpm), so the build is reproducible and the packaged binary matches the release binary.

🤖 Generated with Claude Code

@nicksieger
nicksieger requested a review from a team as a code owner November 9, 2026 21:49
Comment thread pkg/offload/deb/control Resolved
Comment thread pkg/offload/Dockerfile Resolved
Comment thread pkg/offload/verify.Dockerfile Resolved
Comment thread docker-bake.hcl Outdated
Comment on lines +95 to +96
# Packages only the prebuilt linux binaries; darwin and windows ship through the source repo.
offload = ["linux/amd64", "linux/arm64"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ideally, we'd also publish static binaries through download.docker.com for the other platforms. While GitHub "works" to distribute binaries, it's not always ideal, and having a more "official" distribution channel through download.docker.com is good to have.

(we're in process of providing static binaries for all packages that we also provide deb / rpm packages for).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to do this eventually, I have some tickets to follow up on mac and windows binaries, so will revisit in another PR.

@nicksieger
nicksieger force-pushed the offload-packaging branch 2 times, most recently from fb63f47 to 01bfdab Compare November 11, 2026 20:00
Comment thread docker-bake.hcl Outdated
Comment on lines +218 to +233
variable "VERSION" {
description = "Version to build, with v prefix, for example v0.7.52. Only used for the offload package, whose source tree is passed in as the src named context."
default = null
}
variable "COMMIT" {
description = "Short commit of the source tree. Only used for the offload package."
default = null
}
variable "BUILD" {
description = "Build number of the release build. Only used for the offload package."
default = null
}
variable "DATE" {
description = "Commit date of the release tag (YYYY-MM-DD). Only used for the offload package."
default = null
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should have OFFLOAD_ prefix like the other packages

Comment thread pkg/offload/Dockerfile Outdated
Comment on lines +59 to +60
ARG NIGHTLY_BUILD
ARG VERSION

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're not including it in nightly anyway, we can just get rid of the NIGHTLY related variables

Comment thread pkg/offload/scripts/pkg-rpm-build.sh Outdated
--define "_release ${PKG_RPM_RELEASE:-1}"
--define "_srcdir ${SRCDIR}"
--define "_commit ${COMMIT:-$nil}"
--define "_build ${BUILD:-$nil}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_build is already a built-in RPM macro, I'd suggest renaming it to avoid confusion/clashing:

Suggested change
--define "_build ${BUILD:-$nil}"
--define "_buildnum ${BUILD:-$nil}"

@crazy-max

crazy-max commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Why not using remote override like sbx does? https://github.com/docker/packaging#remote-override

It's misleading that I can't build this package if I don't have access to sources

@thaJeztah

Copy link
Copy Markdown
Member

@crazy-max I think this was @vvoland's preference so that we could maintain it to stay aligned with the other packages; IIRC, for sbx that was also the preferred option, but there were some bits that made that not possible

@vvoland vvoland left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I think we might hit some issues with the reproducibility of the binaries, but we can figure it out in the follow ups

Comment thread docker-bake.hcl Resolved
Comment thread docker-bake.hcl Resolved
Comment thread docker-bake.hcl Resolved

@crazy-max crazy-max left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +24 to +26
env:
# offload builds from a private source tree and is built from its own repo.
DISABLED_PACKAGES: offload

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR but we could derive package list from Bake instead of scanning pkg/

@crazy-max

Copy link
Copy Markdown
Member

@thaJeztah

Copy link
Copy Markdown
Member

Yup, won't hurt to do so as well; the CODEOWNERS is not a blocker for me though (can be a follow-up).

Compile the plugin in the package build (dh_auto_build, rpm %build)
through the ce-release make target of the source tree, instead of
packaging prebuilt binaries.

- source tree passed in as the src named context, dependencies
  vendored; no git clone
- GO_VERSION pinned to the release toolchain (1.27.3)
- strip overrides kept so the packaged binary matches the release
  binary
- offload excluded from the nightly package list
- drop offload from PKGS_BASE; callers add it via PKGS_EXTRA

Signed-off-by: Nick Sieger <nick@nicksieger.com>
@vvoland
vvoland merged commit 0be243b into docker:main Nov 18, 2026
1622 of 1623 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants